import React, {useRef} from 'react';
import {useDispatch} from "react-redux";
import {postWeiboAsync} from "../store/slice/weibo";

function TakeComment(props) {
    const dispatch = useDispatch();
    const contentRef = useRef();
    return (
        <div className="takeComment">
            <textarea ref={contentRef} name="textarea" className="takeTextField" id="tijiaoText"></textarea>
            <div className="takeSbmComment">
                <input onClick={()=>dispatch(postWeiboAsync(contentRef))} type="button" className="inputs" value=""/>
            </div>
        </div>
    );
}

export default TakeComment;